Effects, Asynchrony, and Choice in Arrowized Functional Reactive Programming
نویسندگان
چکیده
Functional reactive programming facilitates programming with time-varying data that can be perceived as streams flowing through time. Thus, one can think of FRP as an inversion of flow control from the structure of the program to the structure of the data itself. In a typical (say, imperative) program, the structure of the program governs how the program will behave over time; as time moves forward, the program sequentially executes its statements, and at any line of code, one can make a clear distinction between code that has already been run (the past) and code that has yet to be run (the future). However, in FRP, the program acts as a signal function, and, as such, we are allowed to assume that the program executes continuously on its time-varying inputs—essentially, it behaves as if it is running infinitely fast and infinitely often. We consider this to be the core principle of the design and call it the fundamental abstraction of FRP. Design and Performance This work is specifically rooted in Arrowized FRP, where these signal functions remain static as they process the dynamic signals they act upon. However, in practice, it is often valuable to be able to dynamically alter the way that a signal function behaves over time. Typically, this is achieved with “switching” or other monadic features, but this significantly reduces the usefulness of the arrows. We develop an extension to arrows to allow “predictably dynamic” behavior along with a notion of settability, which together recover the desired dynamic power. We further demonstrate that optimizations designed specifically for arrowized FRP and which do not apply to monadic FRP, such as those for Causal Commutative Arrows, are applicable to the system. Thus, it can be powerfully optimized.
منابع مشابه
Functional reactive programming as a hybrid system framework
In previous work we presented Functional Reactive Programming (FRP), a general framework for designing hybrid systems and developing domain-specific languages for related domains. FRP’s synchronous dataflow features, like event driven switching, supported by higherorder lazy functional abstractions of Haskell allows rapid development of modular and reusable specifications. In this paper, we wil...
متن کاملFunctional Reactive Stream Processing for Data-centric Publish/Subscribe Systems
The Internet of Things (IoT) paradigm has given rise to a new class of applications wherein complex data analytics must be performed in real-time on large volumes of fast-moving, heterogeneous sensor-generated data. Such data streams are often unbounded and must be processed in a distributed and parallel manner to ensure timely processing and delivery to interested subscribers. Dataflow archite...
متن کاملNetworks of Preemptible Reactive Processes: An Implementation
Reactive languages such as Esterel, Lustre, Signal , Statecharts etc have found wide use in the development of veriiable software for reactive applications. It has been recently argued that both asynchrony and perfect synchrony are needed for the speciication of complex reactive systems and a paradigm called Communicating Reactive Processes has been proposed for such a uniication. The paradigm ...
متن کاملScalable Reactive Stream Processing Using DDS and Rx
Event-driven design is fundamental to developing resilient, responsive, and scalable reactive systems as it supports asynchrony and loose coupling. The OMG Data Distribution Service (DDS) is a proven event-driven technology for building data-centric reactive systems because it provides the primitives for decoupling system components with respect to time, space, quality-of-service, and behavior....
متن کاملScalable Reactive Stream Processing Using DDS and Rx: An Industry-Academia Collaborative Research Experience
Event-driven design is fundamental to developing resilient, responsive, and scalable reactive systems as it supports asynchrony and loose coupling. The OMG Data Distribution Service (DDS) is a proven event-driven technology for building data-centric reactive systems because it provides the primitives for decoupling system components with respect to time, space, quality-of-service, and behavior....
متن کامل